﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="All Rights Reserved, Copyright (C) 2013, Wuyeguo, Ltd." />
<title>教学科研管理系统-用户界面</title>
<link rel="stylesheet" type="text/css" href="easyui/1.3.4/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="css/wu.css" />
    <link rel="stylesheet" href="./css/style.css">
	<link rel="stylesheet" type="text/css" href="css/icon.css" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="easyui/1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="easyui/1.3.4/locale/easyui-lang-zh_CN.js"></script>
<style>
	#homepage {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	#homepage .welcome {
		font-size: 28px;
		/*font-family: 楷体;*/
		color: #0277ce;
		font-weight: bold;
	}
</style>
</head>
<body class="easyui-layout">
	
	<div class="wu-header" data-options="region:'north',border:false,split:true">
    	<div class="wu-header-left">
        	<h1>科研项目管理系统</h1>
        </div>
        <div class="wu-header-right">
            <p>
              <strong class="easyui-tooltip" title="2条未读消息"
                ><span id="username"></span></strong
              >，欢迎您！
            </p>
            <p><a href="./pre.html">安全退出</a></p>
          </div>
    </div>
    
    <div class="wu-sidebar" data-options="region:'west',split:true,border:true,title:'导航菜单'">
        <div class="easyui-accordion" data-options="border:false,fit:true">
            <div title="快捷菜单" data-options="iconCls:'icon-application-cascade'" style="padding:5px;" >
                <ul class="easyui-tree wu-side-tree">
                    <li iconCls="icon-text-list-bullets"><a href="javascript:void(0)" data-icon="icon-text-list-bullets" data-link="./userDepartment.html" iframe="0">学院信息</a></li>
                    <li iconCls="icon-text-list-bullets"><a href="javascript:void(0)" data-icon="icon-text-list-bullets" data-link="./userProjectList.html" iframe="0">科研项目列表</a></li>
                    <li iconCls="icon-add"><a href="javascript:void(0)" data-icon="icon-add" data-link="./addResearchProject.html" iframe="0">科研项目立项</a></li>
                    <li iconCls="icon-text-list-bullets"><a href="javascript:void(0)" data-icon="icon-text-list-bullets" data-link="./userfundingList.html" iframe="0">经费审请列表</a></li>
                    <li iconCls="icon-add"><a href="javascript:void(0)" data-icon="icon-add" data-link="./addFundingApproval.html" iframe="0">申请经费</a></li>
                    <li iconCls="icon-text-list-bullets"> <a href="./Project_presentation.html">优秀项目展示</a></li>
                </ul>
            </div>
        </div>
    </div>
    
    <div class="wu-main" data-options="region:'center'">
        <div id="wu-tabs" class="easyui-tabs" data-options="border:false,fit:true">  
            <div title="首页" id="homepage">
				<div class="welcome">欢迎使用科研项目管理系统！</div>
			</div>
        </div>
    </div>
	
    <script type="text/javascript">
        window.onload = () => {
            const user = JSON.parse(localStorage.getItem('userinfo'));
            $('#username').text(user.teacherName);
            $(function(){
                $('.wu-side-tree a').bind("click",function(){
                    var title = $(this).text();
                    var url = $(this).attr('data-link');
                    var iconCls = $(this).attr('data-icon');
                    var iframe = $(this).attr('iframe')==1?true:false;
                    addTab(title,url,iconCls,iframe);
                });
            })
        
            $('#wu-side-tree').tree({
                url:'temp/menu.php',
                cache:false,
                onClick:function(node){
                    var url = node.attributes['url'];
                    if(url==null || url == ""){
                        return false;
                    }
                    else{
                        addTab(node.text, url, '', node.attributes['iframe']);
                    }
                }
            });
            $('#wu-tabs').tabs({
                tools:[{
                    iconCls:'icon-reload',
                    border:false,
                    handler:function(){
                        $('#wu-datagrid').datagrid('reload');
                    }
                }]
            });
            
            
            function addTab(title, href, iconCls, iframe){
                iframe = true;
                var tabPanel = $('#wu-tabs');
                if(!tabPanel.tabs('exists',title)){
                    var content = '<iframe scrolling="auto" frameborder="0"  src="'+ href +'" style="width:100%;height:100%;"></iframe>';
                    if(iframe){
                        tabPanel.tabs('add',{
                            title:title,
                            content:content,
                            iconCls:iconCls,
                            fit:true,
                            cls:'pd3',
                            closable:true
                        });
                    }
                }
                else
                {
                    tabPanel.tabs('select',title);
                }
            }
            
            function removeTab(){
                var tabPanel = $('#wu-tabs');
                var tab = tabPanel.tabs('getSelected');
                if (tab){
                    var index = tabPanel.tabs('getTabIndex', tab);
                    tabPanel.tabs('close', index);
                }
            }
        }
	</script>
</body>
</html>
